import { call, put, takeEvery } from 'redux-saga/effects'

function fecthMenu_(url) {
    return new Promise(resolve => {
        resolve(
            [
                {
                    'name': '轮播图',
                    'component': '',
                    'path': '/banners'
                },
                {
                    'name' : '合作伙伴',
                    'component' : '',
                    'path': '/op'
                },
                {
                    'name' : '合作伙伴',
                    'component' : '',
                    'path': '/op/xixi'
                }
            ]
        )
    })
}
function* fecthMenu() {
    const menu = yield call(fecthMenu_, 'url:/????');
    yield put({
        type : 'SET_MENU',
        menu
    })
}

export function* getMenu() {
    yield takeEvery('GET_MENU', fecthMenu)
}
